Air quality in Barcelona
Goal
To perform high level exploratory analysis of Barcelona’s air quality for January of 2019. Data source is Barcelona’s City Hall Open Data Service
The historical resources show only data from the stations in Barcelona for O3 (tropospheric Ozone), NO2 (Nitrogen dioxide), PM10 (Suspended particles).
Explore the Data
Location patterns exploration
Below we can observe different variations of visualisation how different pollutant distributed in each station.
## nom_cabina qualitat_aire codi_dtes zqa codi_eoi longitud
## 1 Barcelona - Sants Bona ID 1 8019042 2.1331
## 2 Barcelona - Eixample Regular IH 1 8019043 2.1538
## 3 Barcelona - Gràcia Regular IJ 1 8019044 2.1534
## 4 Barcelona - Ciutadella Bona IL 1 8019050 2.1874
## 5 Barcelona - Vall Hebron Bona IN 1 8019054 2.1480
## 6 Barcelona - Palau Reial Bona IZ 1 8019057 2.1151
## latitud hora_o3 qualitat_o3 valor_o3 hora_no2 qualitat_no2 valor_no2
## 1 41.3788 <NA> <NA> <NA> 23h Bona 86 µg/m³
## 2 41.3853 23h Bona 3 µg/m³ 23h Regular 112 µg/m³
## 3 41.3987 23h Bona 3 µg/m³ 23h Regular 113 µg/m³
## 4 41.3864 23h Bona 2 µg/m³ 23h Bona 74 µg/m³
## 5 41.4261 23h Bona 10 µg/m³ 23h Bona 67 µg/m³
## 6 41.3875 0h Bona 1 µg/m³ 0h Bona 65 µg/m³
## hora_pm10 qualitat_pm10 valor_pm10 generat dateTime
## 1 <NA> <NA> <NA> 01/01/2019 0:00 1546297502
## 2 23h Bona 36 µg/m³ 01/01/2019 0:00 1546297502
## 3 23h Regular 39 µg/m³ 01/01/2019 0:00 1546297502
## 4 <NA> <NA> <NA> 01/01/2019 0:00 1546297502
## 5 23h Bona 12 µg/m³ 01/01/2019 0:00 1546297502
## 6 0h Bona 15 µg/m³ 01/01/2019 0:00 1546297502
There are some NA values. Within this research NA´s will be replaced by zero´s.
## # A tibble: 8 x 5
## nom_cabina valor_no2 valor_o3 valor_pm10 total_pollution
## <chr> <dbl> <dbl> <dbl> <dbl>
## 1 Ciutadella 27238 16948 0 44186
## 2 Eixample 30405 14252 15456 60113
## 3 Gràcia 28674 15383 15417 59474
## 4 Observ Fabra 7957 42656 7410 58023
## 5 Palau Reial 18357 22085 9395 49837
## 6 Poblenou 30073 0 16344 46417
## 7 Sants 24111 0 0 24111
## 8 Vall Hebron 20314 27610 10440 58364
## # A tibble: 8 x 5
## nom_cabina valor_no2 valor_o3 valor_pm10 total_pollution
## <chr> <dbl> <dbl> <dbl> <dbl>
## 1 Ciutadella 27238 16948 0 44186
## 2 Eixample 30405 14252 15456 60113
## 3 Gràcia 28674 15383 15417 59474
## 4 Observ Fabra 7957 42656 7410 58023
## 5 Palau Reial 18357 22085 9395 49837
## 6 Poblenou 30073 0 16344 46417
## 7 Sants 24111 0 0 24111
## 8 Vall Hebron 20314 27610 10440 58364
Below we can see data distributiution for each station (zero values are excluded in order to see beter non-zero results).
We can see, that majority of values is distributed between 0 and 100, but there are some unique values around 200, for example for Ciutadella, Eixample and Gracia. It is recommended to double check, if these values are correct or it is just outliers.
Time patterns exploration
Let´s plot pollution level distribution within the day.
We can see, that O3 (tropospheric Ozone), NO2 (Nitrogen dioxide) pollution level varies during the day, but pollution by PM10 (Suspended particles) is almost constant .Another observation, which we could not clearly see on the bar chart and line chart demonstrates it, that O3 (tropospheric Ozone) and NO2 (Nitrogen dioxide) are codependant pollutants.
It make sence, as the majority of tropospheric ozone formation occurs when nitrogen oxides.
We can see it on plots for all locations except Observ Fabra. This would be interesting to investigate - if it is issue with the data collection or some specifics of the location?
There is no data about tropospheric ozone in Sants and Poblenou, most probably it is data collection issue rather than the fact, that this pollutant is not present in these locations.
__ It is possible to remove any line, by clicking on the pollutant in the legend__
On the charts below we can observe trend of pollution dynamic during the weekdays.
Time Variation for nitrogen dioxide:
Time Variation for tropospheric ozone:
Time Variation for suspended particles:
Time Variation for all pollutants:
As we can see NO2 ((Nitrogen dioxide)) level have spike on Friday afternoon and decreases on Sunday. As it was mentioned above O3 level behaviour looks inversely proportional to NO2 and we can see it on time variation charts as well.
For O3 (tropospheric Ozone) it is opposite - lowest level on Friday and growth on Wed, Thuesday & Sunday.
PM10 (Suspended particles) have low variation, that is why it looked as constant on the bar chart, but here we can see, that there is some trend as well - during Sunday - Monday before noon it has the lowest level.
Resume
1.1. Does the pollution level depend on the time of the day?
Yes, for O3 (tropospheric Ozone), NO2 (Nitrogen dioxide) pollution level varies during the day, but pollution by PM10 (Suspended particles) is almost constant - variation is quite low .
1.2. Analyse the differences between locations?
Pollution measures for some locatinos are missing, so looks like the most polluted locations are Eixample, Gràcia, Observ Fabra and Vall Hebron. While Sants is the less polluted location. But to make final conclusions it is needed to check the reason of missing data.
1.3. What’s the most problematic pollutant?
The most problematic pollutant according to this dataset is Nitrogen dioxide.